<%@ page import="com.UserBean"%>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Statement" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:useBean id="username" class="com.UserBean" scope="application"></jsp:useBean>
<jsp:setProperty name="username" property="*"></jsp:setProperty>
<%
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/book";
        Connection connection= DriverManager.getConnection(url,"root","root");

        Statement stmt=connection.createStatement();
        //String sql="insert into username(username,password,gender,age) values('"+username.getUsername()+"','"+username.getPassword()+"',2,11)";

        //String sql="update user age= 42 where id=5";

        String sql="delete from username where id=4";
        int count=stmt.executeUpdate(sql);

        if(count>0){
            out.print("删除成功");
        }else {
            out.print("删除失败");
        }
        %>
